package dao

import "gorm.io/gorm"

// 试题表
type Subjects struct {
	gorm.Model
	SubjectClassification string     `json:"subject_classification" gorm:"comment:试题分类名称"`
	TitleClassification   int        `json:"title_classification" gorm:"type:int;comment:题型分类1-单选2-多选"`
	Title                 string     `gorm:"type:varchar(255);not null;comment:题干"`
	Option                int        `gorm:"type:int(1);not null;comment:正确选项"`
	Difficulty            int        `gorm:"comment:难度 1-容易 2-中等 3-困难 4-不限难度"`
	Pid                   int        `gorm:"comment:父id 试题分类;default:0"`
	Children              []Subjects `gorm:"-"`
}

// 试卷表
type TestPaper struct {
	gorm.Model
	Status             int        `gorm:"comment:状态 1-进行 2-未开始 3-已结束"`
	TestName           string     `json:"test_name" gorm:"varchar(30);comment:试题名称"`
	TestClassification int        `json:"test_classification" gorm:"type:int(10);comment:试卷分类"`
	Random             int        `gorm:"comment:题目抽取 1-随机2-固定"`
	Num                int        `gorm:"type:int(5);not null;comment:试题数量"`
	Or                 int        `gorm:"type:int(1);not null;comment:是否发布1-已发布2-已停用"`
	UserId             int        `gorm:"comment:创建人"`
	SubjectID          int        `json:"subject_id" gorm:"index"`
	Subjects           []Subjects `gorm:"-"`
}
